<?php
define('IN_ECS', true);
require('../includes/init.php');
include_once('fmconfig.php');
$fmuid = $_SESSION['user_id'];
$info = '';
//һ������
$sql1 = "select * from ".$ecs->table('category')." where parent_id = ".$fmmenu['jewelry'];
$data = $GLOBALS['db']->getAll($sql1);

$menu = '';
foreach($data as $d){
    $menu .= "<item label='".$d['cat_name']."'>";
    $sql2 = "select a.* from ".$ecs->table('goods')." as a  where a.cat_id=".$d['cat_id'];
    $data1 = $GLOBALS['db']->getAll($sql2);
    if(count($data1)>0){
        foreach($data1 as $d1){
            $menu .= "<item id='".$d1['goods_id']."' label='".$d1['goods_name']."' data='".$d1['goods_sn']."' />";
        }
    }
    $menu .= "</item>";
}
$menu = '<root>'.$menu.'</root>';

echo $menu;


?>